public class TestDemo {
    public static void main(String[] args) {
        int n = 7;
        int i;
        for(i = 31; i >= 1; i -= 2) {
            System.out.print(n >>> i & 1);
        }
        System.out.println();
        for(i = 30; i >= 0; i -= 2) {
            System.out.print(n >>> i & 1);
        }
    }

    public static void main_07(String[] args) {
        int n = -1;
        int count;
        for(count = 0; n != 0; n &= n - 1) {
            ++count;
        }
        System.out.println(count);
    }

    public static void main_06(String[] args) {
        int n = 10;
        int count;
        for(count = 0; n != 0; n >>>= 1) {
            if ((n & 1) != 0) {
                ++count;
            }
        }
        System.out.println(count);
    }

    public static void main_05(String[] args) {
        int n = -1;
        int count = 0;
        for(int i = 0; i < 32; ++i) {
            if ((n >>> i & 1) != 0) {
                ++count;
            }
        }
        System.out.println(count);
    }

    public static void main_04(String[] args) {
        for(int i = 0; i < 999999; ++i) {
            int tmp = i;
            int count;
            for(count = 0; tmp != 0; tmp /= 10) {
                ++count;
            }
            tmp = i;
            int sum;
            for(sum = 0; tmp != 0; tmp /= 10) {
                sum = (int)((double)sum + Math.pow((double)(tmp % 10), (double)count));
            }
            if (sum == i) {
                System.out.println(i);
            }
        }
    }

    public static void main_03(String[] args) {
        int a = 18;
        int b = 24;
        for(int c = a % b; c != 0; c = a % c) {
            a = b;
            b = c;
        }
        System.out.println(b);
    }

    public static void main_02(String[] args) {
        for(int i = 1; i <= 9; ++i) {
            for(int j = 1; j <= i; ++j) {
                System.out.print(i + "*" + j + "=" + i * j + " ");
            }
            System.out.println();
        }
    }

    public static void main_01(String[] args) {
        for(int n = 1; n < 101; ++n) {
            int i;
            for(i = 2; (double)i <= Math.sqrt((double)n) && n % i != 0; ++i) {
            }
            if ((double)i > Math.sqrt((double)n)) {
                System.out.println(n + "是素数！");
            }
        }
    }
}
